<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="newtemplatesfiles5/img/favicon.html">

    <title>转售</title>
    <link rel="stylesheet" href="asserts/css/swiper-bundle.min.css">
    <!-- Bootstrap core CSS -->
    <link href="newtemplatesfiles5/css/bootstrap.min.css" rel="stylesheet">
    <link href="newtemplatesfiles5/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="newtemplatesfiles5/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="newtemplatesfiles5/css/style.css" rel="stylesheet">
    <link href="newtemplatesfiles5/css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
    <script src="newtemplatesfiles5/js/html5shiv.js"></script>
    <script src="newtemplatesfiles5/js/respond.min.js"></script>
    <![endif]-->
    <!--弹出框style-->
    <style>
        /*弹出层*/
        #popBox {
            display: none;
            background-color: honeydew;
            z-index: 11;
            width: 400px;
            height: 300px;
            position:fixed;
            top:0;
            right:0;
            left:0;
            bottom:0;
            margin:auto;
        }

        #popBox .close{
            text-align: right;
            margin-right: 5px;
            background-color: #F8F8F8;
        }

        /*关闭按钮*/
        #popBox .close a {
            text-decoration: none;
            color: red;
        }

        #popBox .auto {
            margin-left: 50px;
            margin-right: 50px;
            margin-top: 50px;

        }
        .box::before {

            content: "";
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 2;
            background-color: #000;
            opacity: .3;
        }
    </style>
</head>
<body lang="en">
<section id="container" class="">
    <!--header start-->
    <div th:insert="common/student-common-header::top"></div>
    <!--header end-->
    <!--sidebar start-->
    <div th:insert="common/student-common-sidebar::#left"></div>
    <!--sidebar end-->
    <!--main content start-->
    <aside id="main-content">
        <as class="wrapper">
            <!-- page start-->
            <section class="row">
                <div th:insert="common/student-sell-left::#student-sell-left"></div>
                <div class="profile-info col-lg-9">

                    <header>
                        <h1>等待付款的订单</h1>
                    </header>
                    <tr th:each="emp:${session.waitPayOrderImplList}">
                        <section class="panel">
                            <div class="panel-body bio-graph-info">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <h1><img alt="" style="width: 40px" th:src="${emp.seller.image}">
                                            <span th:text="${emp.seller.nickName}"></span></h1>
                                        <br><label>车牌号 :</label><a th:text="${emp.ebick.ebickID}"></a>
                                        <br><label>品牌 :</label><a th:text="${emp.ebick.brand}"></a>
                                        <br><label>首次注册时间 :</label><a th:text="${emp.ebick.firstRegistTime}"></a>
                                        <br><label>价格 :</label><a th:text="${emp.ebickGoods.price}"></a>
                                    </div>
                                    <div class="col-lg-6">
                                        <label>订单号 :</label><a th:text="${emp.orderForm.orderFormID}"></a>
                                        <label>时间 :</label><a th:text="${emp.orderForm.date}"></a>
                                        <br><label>备注 :</label><a th:text="${emp.orderForm.details}"></a>
                                        <br><label>状态 :</label><a th:text="${emp.orderForm.status}"></a>
                                        <br><img style="width: 100px" th:src="${emp.ebick.image}">
                                    </div>
                                </div>
                                <footer class="twt-footer">
                                        <button class="btn btn-sm btn-danger" onclick="popBox(this)">
                                            <i class="icon-location-arrow"></i>
                                            付款</button>
                                </footer>
                            </div>
                        </section>
                        <div class="box" style="display: none;">
                            <div id="popBox" name="popBox" class="popBox content-center">
                                <form id="payForm" class="payForm">
                                    <div>
                                        <input type="hidden" name="orderFormID" th:value="${emp.orderForm.orderFormID}">
                                    </div>

                                    <div class="close">
                                        <a href="javascript:void(0)" onclick="closeBox(this)">关闭</a>
                                    </div>
                                    <div class="auto">
                                        <h2>付款<h1 th:text="${emp.ebickGoods.price}"> 元</h1></h2><br>
                                        密码：<input class="form-control" type="password" name="payPassword">
                                    </div>
                                </form>
                                <div style="margin-left: 50px;margin-top:10px">
                                    <button id="jixuScan" class="btn btn-danger" onclick="yesPay(this)">确认支付</button>
                                </div>

                            </div>
                        </div>


                        <script>
                            function  yesPay(obj) {
                                alert("确认支付吗？");
                                var form = obj.parentElement.parentElement.getElementsByClassName("payForm")[0];
                                form = new FormData(form);
                                $.ajax({
                                    url:"student-pay.do",
                                    type:"post",
                                    dataType:"html",
                                    data:form,
                                    cache:false,
                                    async: false, // 是否异步
                                    processData:false,
                                    contentType:false,
                                    success: function (data) {
                                        if(data == "success"){
                                            alert("支付成功！");
                                            location.href="studentGetAllMyBuyOrders.do";
                                        }else if(data == "toInvest"){
                                            alert("您的余额不足，是否前去充值");
                                            location.href="student-getMyWallet.do";
                                        }else if(data == "请先登录"){
                                            alert("请先登录");
                                            location.href="login";
                                        }else{
                                            alert(data);
                                        }
                                    },
                                    error:function (data) {
                                        alert("系统错误");
                                    }
                                })
                            }

                            /*点击弹出按钮*/
                            function popBox(obj) {
                                $.ajax({
                                    url:"student-ifhaveWallet.do",
                                    type:"post",
                                    dataType:"html",
                                    cache:false,
                                    async: false, // 是否异步
                                    processData:false,
                                    contentType:false,
                                    success: function (data) {
                                        //alert(data);
                                        if(data=="yes"){
                                            var popBox = obj.parentElement.parentElement.parentElement.parentElement.getElementsByClassName("popBox")[0];
                                            popBox.style.display = "block";
                                            var box = popBox.parentElement;
                                            box.style.display = "block";
                                        }else if(data=="no"){
                                            alert("还没有开通钱包功能，是否前去开通");
                                            location.href="student-creatOneWallet";
                                        }else{
                                            alert("系统错误");
                                        }
                                    },
                                    error:function (data) {
                                        alert("系统错误");
                                    }
                                })
                            };
                            /*点击关闭按钮*/
                            function closeBox(obj) {
                                var popBox = obj.parentElement.parentElement.parentElement.parentElement;
                                popBox.style.display = "none";
                            }
                        </script>

                    </tr>

                    <header>
                        <h1>等待收货的订单</h1>
                    </header>
                    <tr th:each="emp:${session.waitReceiveOrderImplList}">
                        <section class="panel">
                            <div class="panel-body bio-graph-info">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <h1><img alt="" style="width: 40px" th:src="${emp.seller.image}">
                                            <span th:text="${emp.seller.nickName}"></span></h1>
                                        <br><label>车牌号 :</label><a th:text="${emp.ebick.ebickID}"></a>
                                        <br><label>品牌 :</label><a th:text="${emp.ebick.brand}"></a>
                                        <br><label>首次注册时间 :</label><a th:text="${emp.ebick.firstRegistTime}"></a>
                                        <br><label>价格 :</label><a th:text="${emp.ebickGoods.price}"></a>
                                    </div>
                                    <div class="col-lg-6">
                                        <label>订单号 :</label><a class="orderFormID" th:text="${emp.orderForm.orderFormID}"></a>
                                        <label>时间 :</label><a th:text="${emp.orderForm.date}"></a>
                                        <br><label>备注 :</label><a th:text="${emp.orderForm.details}"></a>
                                        <br><label>状态 :</label><a th:text="${emp.orderForm.status}"></a>
                                        <br><img style="width: 100px" th:src="${emp.ebick.image}">
                                    </div>
                                </div>
                                <footer class="twt-footer">
                                    <button class="btn btn-sm btn-danger" onclick="yesReceiveEick(this)">确认收货</button>
                                    <button class="btn btn-sm btn-danger" onclick="backMoney(this)">退款</button>
                                    <script>
                                        function yesReceiveEick(obj) {
                                            alert("确定收货吗？");
                                            var orderFormID = obj.parentElement.parentElement.getElementsByClassName("orderFormID")[0].textContent;
                                            var form = new FormData();
                                            form.append("orderFormID",orderFormID);
                                            $.ajax({
                                                url:"student-yesReceiveEbick.do",
                                                type:"post",
                                                dataType:"html",
                                                data:form,
                                                cache:false,
                                                processData:false,
                                                contentType:false,
                                                success: function (data) {
                                                    if(data=="success"){
                                                        alert("收货成功！");
                                                        location.href="studentGetAllMyBuyOrders.do";
                                                    }else {
                                                        alert(data);
                                                    }
                                                },
                                                error:function (data) {
                                                    //console.log("error");
                                                    alert("系统错误");
                                                }
                                            })
                                        };


                                        function backMoney(obj) {
                                            alert("确定退款吗？");
                                            var orderFormID = obj.parentElement.parentElement.getElementsByClassName("orderFormID")[0].textContent;
                                            var form = new FormData();
                                            form.append("orderFormID",orderFormID);
                                            $.ajax({
                                                url:"student-backMoney.do",
                                                type:"post",
                                                dataType:"html",
                                                data:form,
                                                cache:false,
                                                processData:false,
                                                contentType:false,
                                                success: function (data) {
                                                    if(data=="success"){
                                                        alert("退款成功！");
                                                        location.href="studentGetAllMyBuyOrders.do";
                                                    }else {
                                                        alert(data);
                                                    }
                                                },
                                                error:function (data) {
                                                    //console.log("error");
                                                    alert("系统错误");
                                                }
                                            })
                                        }
                                    </script>
                                </footer>
                            </div>
                        </section>
                    </tr>


                    <header>
                        <h1>等待确定的订单</h1>
                    </header>
                    <tr th:each="emp:${session.waitConfirmOrderImplList}">
                        <section class="panel">
                            <div class="panel-body bio-graph-info">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <h1><img alt="" style="width: 40px" th:src="${emp.seller.image}">
                                            <span th:text="${emp.seller.nickName}"></span></h1>
                                        <br><label>车牌号 :</label><a th:text="${emp.ebick.ebickID}"></a>
                                        <br><label>品牌 :</label><a th:text="${emp.ebick.brand}"></a>
                                        <br><label>首次注册时间 :</label><a th:text="${emp.ebick.firstRegistTime}"></a>
                                        <br><label>价格 :</label><a th:text="${emp.ebickGoods.price}"></a>
                                    </div>
                                    <div class="col-lg-6">
                                        <label>订单号 :</label><a th:text="${emp.orderForm.orderFormID}"></a>
                                        <label>时间 :</label><a th:text="${emp.orderForm.date}"></a>
                                        <br><label>备注 :</label><a th:text="${emp.orderForm.details}"></a>
                                        <br><label>状态 :</label><a th:text="${emp.orderForm.status}"></a>
                                        <br><img style="width: 100px" th:src="${emp.ebick.image}">
                                    </div>
                                </div>
                                <footer class="twt-footer">
                                    <a th:href="@{/student-cancelBuyOrder.do(orderFormID=${emp.orderForm.orderFormID})}">
                                        <button class="btn btn-sm btn-danger">
                                            <i class="icon-location-arrow"></i>
                                            撤回</button>
                                    </a>
                                </footer>
                            </div>
                        </section>
                    </tr>

                        <header>
                            <h1>已完成的订单</h1>
                        </header>
                        <tr th:each="emp:${session.finishedOrderImplList}">
                            <section class="panel">
                                <div class="panel-body bio-graph-info">
                                    <div class="row">
                                        <div class="col-lg-6">
                                            <h1><img alt="" style="width: 40px" th:src="${emp.seller.image}">
                                                <span th:text="${emp.seller.nickName}"></span></h1>
                                            <br><label>车牌号 :</label><a th:text="${emp.ebick.ebickID}"></a>
                                            <br><label>品牌 :</label><a th:text="${emp.ebick.brand}"></a>
                                            <br><label>首次注册时间 :</label><a th:text="${emp.ebick.firstRegistTime}"></a>
                                            <br><label>价格 :</label><a th:text="${emp.ebickGoods.price}"></a>
                                        </div>
                                        <div class="col-lg-6">
                                            <label>订单号 :</label><a th:text="${emp.orderForm.orderFormID}"></a>
                                            <label>时间 :</label><a th:text="${emp.orderForm.date}"></a>
                                            <br><label>备注 :</label><a th:text="${emp.orderForm.details}"></a>
                                            <br><label>状态 :</label><a th:text="${emp.orderForm.status}"></a>
                                            <br><img style="width: 100px" th:src="${emp.ebick.image}">
                                        </div>
                                    </div>
                                </div>
                            </section>
                        </tr>

                    <header>
                        <h1>已拒绝的订单</h1>
                    </header>
                    <tr th:each="emp:${session.rejectedOrderImplList}">
                        <section class="panel">
                            <div class="panel-body bio-graph-info">
                                <div class="row">
                                    <div class="col-lg-6">
                                        <h1><img alt="" style="width: 40px" th:src="${emp.seller.image}">
                                            <span th:text="${emp.seller.nickName}"></span></h1>
                                        <br><label>车牌号 :</label><a th:text="${emp.ebick.ebickID}"></a>
                                        <br><label>品牌 :</label><a th:text="${emp.ebick.brand}"></a>
                                        <br><label>首次注册时间 :</label><a th:text="${emp.ebick.firstRegistTime}"></a>
                                        <br><label>价格 :</label><a th:text="${emp.ebickGoods.price}"></a>
                                    </div>
                                    <div class="col-lg-6">
                                        <label>订单号 :</label><a th:text="${emp.orderForm.orderFormID}"></a>
                                        <label>时间 :</label><a th:text="${emp.orderForm.date}"></a>
                                        <br><label>备注 :</label><a th:text="${emp.orderForm.details}"></a>
                                        <br><label>状态 :</label><a th:text="${emp.orderForm.status}"></a>
                                        <br><img style="width: 100px" th:src="${emp.ebick.image}">
                                    </div>
                                </div>
                            </div>
                        </section>
                    </tr>

                </div>

            </section>
        </as>
    </aside>
</section>

</body>
<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="asserts/js/popper.min.js"></script>
<script src="asserts/js/feather.min.js"></script>
<script src="asserts/js/bootstrap.min.js"></script>
<!-- js placed at the end of the document so the pages load faster -->
<script src="newtemplatesfiles5/js/jquery.js"></script>
<script src="newtemplatesfiles5/js/bootstrap.min.js"></script>
<script src="newtemplatesfiles5/js/jquery.scrollTo.min.js"></script>
<script src="newtemplatesfiles5/js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="newtemplatesfiles5/assets/jquery-knob/js/jquery.knob.js"></script>

<!--common script for all pages-->
<script src="newtemplatesfiles5/js/common-scripts.js"></script>

<script>
    window.onload=function(){
        $("#li1").removeClass('active');
        $("#li2").removeClass('active');
        $("#li3").removeClass('active');
        $("#li4").removeClass('active');
        $("#li5").addClass('active');

    };
    //knob
    $(".knob").knob();

    function verifyLoginStatus() {
        //验证登录状态
        console.log("1");
        var message = document.getElementById("mystatus").innerText;
        console.log(message);
        if(message == '请先登录'){
            alert("请登录");
            location.href="login";
            return '1';
        }
        return '2';
    };

    function mysubmit(){
        var status = verifyLoginStatus();
        if(status == '2'){
            var form = new FormData(document.getElementById("goodsForm"));
            $.ajax({
                url:"student-uploadGoodsEbick.do",
                type:"post",
                dataType:"html",
                data:form,
                cache:false,
                processData:false,
                contentType:false,
                success: function (data) {
                    if(data=="success"){
                        alert("添加成功！");
                        location.href="";
                    }else {
                        alert(data);
                    }
                },
                error:function (data) {
                    console.log("error");
                    alert("添加失败");
                }
            })
        }
    };


</script>
<!--swiper js-->
<script src="js/swiper-bundle.min.js"> </script>
<script>
    var mySwiper = new Swiper ('.swiper', {
        direction: 'horizontal', // 垂直切换选项
        loop: true, // 循环模式选项
        autoplay: {
            delay: 3000,//3秒切换一次
        },
        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },

        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },

        // 如果需要滚动条
        scrollbar: {
            el: '.swiper-scrollbar',
        },
    })
</script>
<style>
    .swiper {
        width: 600px;
        height: 400px;
    }
</style>
</html>
